package com.zz.parkingsystem.entity;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 考勤表
 * @TableName t_checkOn
 */
@Data
public class Checkon implements Serializable {
    /**
     * 考勤表编号
     */
    private Integer coId;

    /**
     * 巡查id
     */
    private Integer insId;

    /**
     * 考勤时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date coTime;

    /**
     * 考勤状态 0:正常，1：迟到，2：休假
     */
    private Integer coStatus;
    private String insNickname;
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Checkon other = (Checkon) that;
        return (this.getCoId() == null ? other.getCoId() == null : this.getCoId().equals(other.getCoId()))
            && (this.getInsId() == null ? other.getInsId() == null : this.getInsId().equals(other.getInsId()))
            && (this.getCoTime() == null ? other.getCoTime() == null : this.getCoTime().equals(other.getCoTime()))
            && (this.getCoStatus() == null ? other.getCoStatus() == null : this.getCoStatus().equals(other.getCoStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCoId() == null) ? 0 : getCoId().hashCode());
        result = prime * result + ((getInsId() == null) ? 0 : getInsId().hashCode());
        result = prime * result + ((getCoTime() == null) ? 0 : getCoTime().hashCode());
        result = prime * result + ((getCoStatus() == null) ? 0 : getCoStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", coId=").append(coId);
        sb.append(", insId=").append(insId);
        sb.append(", coTime=").append(coTime);
        sb.append(", coStatus=").append(coStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}